import 'package:dio/dio.dart';
import 'package:flutter_oldman_health/utils/utils.dart';

class HeaderInterceptor extends Interceptor {
  @override
  Future onRequest(RequestOptions options) async {
    String token = await Utils.getStrSharePreferences("token");

    if (null != token && token.isNotEmpty) {
      print("token $token");
      options.headers.addAll({'token': token});
    }
    return options;
  }
}
